home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Netware Super Library
/
Netware Super Library.iso
/
mhs_mail
/
adminapp
/
adminapp.doc
< prev
next >
Wrap
Text File
|
1995-01-11
|
20KB
|
554 lines
┌───────────────────────────────────────────────────────────┐
│ │
│ The Administrator's Apprentice │
│ │
│ │
│ │
│ System Management by E-Mail - An MHS-based NLM │
│ │
└───────────────────────────────────────────────────────────┘
Contents
Introduction
Requirements
Installation
Creating Accounts
Loading the NLM
Configuration File
Commands accepted by E-Mail
The CRC32 Utility Program
Planned enhancements
Revision History
Ordering Information
Copyright (C) 1994 PH Consulting
A-3704 Grosswetzdorf 1
AUSTRIA
┌──────────────┐
│ Introduction │
└──────────────┘
Administrator's Apprentice is an NLM for use on NetWare 3.x and 4.x.
It interfaces with MHS (SMF-70 or SMF-71, i.e. MHS 1.5, Global MHS
or Infinite Technologies' Connect²) to receive commands from and send
alerts to the administrator (supervisor).
Functions include:
- NetWare broadcast message to Mail conversion
NetWare broadcast messages to a specified user (the type of
message normally displayed in the bottom line of a user's
screen by the NetWare shell) are not buffered, so they are
easy to miss. This NLM traps such messages and sends the
administrator an E-mail message instead.
Benign messages may be filtered.
- Remote File Server Console Status
Upon receiving a command to do so, the NLM will take a "snapshot"
of the server console's virtual screens and return them to the
administrator.
- Execute console commands
Batches of console commands can be executed. Execution can be
delayed for a specific time, or until an NLM is loaded/unloaded.
- Print attached files to a specified queue
Automatically print orders, invoices or anything else to a
printer queue residing on the local file server.
- List directory or calculate file CRC remotely
Want to check which versions of a program a remote site is
running? Send a one-line E-mail message.
The (multithreaded) NLM runs completely in the background and
causes no noticeable server load when idle. It only polls the
server in regular intervals.
When executing a command, utmost care is taken to minimize load
on the server's CPU. The commands execute fast enough to prevent
any noticeable server performance degradation.
This NLM is particularly useful for monitoring remote sites that
do not have an on-line (WAN) connection to the main LAN, but can
be reached through E-mail.
┌──────────────┐
│ Requirements │
└──────────────┘
ADMINAPP runs on NetWare 3.11, 3.12, 4.00, 4.01 and 4.02.
Note that ADMINAPP requires CLIB 3.12f or later on NetWare 3.x.
If you are running Netware 3.11, don't be alarmed - you can also
upgrade to CLIB 3.12x. As of this writing, the most current version
is 3.12g, which is found in the file LIBUP3 or LIBUP4 (available in
the NOVLIB forum on CompuServe or from ftp.novell.com on Internet).
Novell does acknowledge a problem with CLIB 3.12g and GMHS 2.0, and
recommends using CLIB 3.12f in this configuration.
If you are for some reason unable to upgrade to CLIB 3.12f+, please
contact PH Consulting (addresses at the end of this document) for
a separate Backward Compatibility Module.
┌──────────────┐
│ Installation │
└──────────────┘
To install Administrator's Apprentice, copy ADMINAPP.NLM,
ADMINAPP.CFG and either ADAPP30D.NLM (for a 30-day trial)
or ADAPPINS.NLM (for the retail version) to SYS:SYSTEM.
At the file server console, enter
LOAD ADAPP30D
to start the 30 day trial period or
LOAD ADAPPINS
to install the retail product. Note that Administrator's Apprentice
is licensed by NetWare File Server, independent of NetWare user count
or MHS licensing.
Next, edit the configuration file. You may use the command
LOAD EDIT SYS:SYSTEM/ADMINAPP.CFG
at the file server console or any text editor from an attached
station. Follow the comments in the sample ADMINAPP.CFG to fill in
the proper parameters for your configuration. You should enter an MHS
mail address and a local NetWare user name (see description below).
┌───────────────────┐
│ Creating Accounts │
└───────────────────┘
If you have not already done so (or used an existing account),
use SYSCON or NETADMIN to create the user account the the NLM
will use to log in to the file server. This account need not have
any special rights to the file system; it is only used to receive
broadcast messages.
Make sure that this user account is specified in the appropriate
places in other programs (such as backup utilities) and/or is a
member of the proper user groups to receive all the broadcast
messages that you want.
Note that you may restrict this account's login address to
(file server internal net: node 1)
if you want to make sure it is not used by someone trying to
obtain undue access to the server over the network.
Also, if the MHS mail account specified above does not exist yet,
create it now. IMPORTANT: Make sure that MHS is the preferred
application defined for this account.
Verify that you can log in to the server from a workstation
using the username and password specified in the ADMINAPP.CFG
file as
[BROADCASTS]
NetWareUserName = AdminApp
NetWarePassword = AdminAppPassword
┌─────────────────┐
│ Loading the NLM │
└─────────────────┘
At the file server console, enter
LOAD ADMINAPP
┌────────────────────┐
│ Configuration File │
└────────────────────┘
The configuration is read from the file SYS:SYSTEM/ADMINAPP.CFG.
This file follows the Windows conventions of INI files, i.e. it
is divided into sections (indicated by section names in []),
which hold a number of assignments of the form
Parameter = Value
Blanks around the equals sign are ignored if present.
Comments can be entered on blank lines by prefixing them with a
semicolon. Upper/lowercase is ignored for the parameter names.
Path values must be entered in NetWare format:
Volume:Dir1\Dir2\Dir3
The volume name must be specified. A forward slash may be used
instead of a back slash. Volumes must be on the local server;
this NLM does not support logging in to other servers.
┌─────────────────────────────┐
│ Commands accepted by E-Mail │
└─────────────────────────────┘
Administrator's Apprentice reads E-mail messages addressed to it
and processes the command specified on the "Subject:" line of the
message. The following commands are defined:
PRINT Queuename
Enters attached file(s) as job(s) in the specified print queue.
STATUS [G][V][C][N][S][T][*]
Returns a status report to the sender of the message.
Contents: G = General, V = Volumes, C = Connections, N = NLMs,
S = Screens, B = Bindery, P = Bindery + Properties
Any or all of the optional report types may be specified. An
Asterisk may be specified in place of the options to get all of
the reports. If no options are specified, a "Vols/Conns/Screens"
report is returned.
IGNORE
Ignores this message completely.
CONSOLE ConsolePassword
Interprets the lines of the message body. The console password
must match the one specified in ADMINAPP.CFG for the message to
be processed.
The following keywords are recognized:
COMMAND ConsoleCommandLine
The console command line is passed to NetWare.
STATUS MHS-Address;[G][V][C][S][T]
Sends a status report to the address specified (in this case
it can be different from the sender's address).
The address must be present and is separated from the options
by a semicolon.
DELAY NumberOfSeconds
Delays for the specified number of seconds.
Note that polling for broadcast messages is not affected
because this continues to run in another thread.
(CONSOLE sub-commands continued on next page)
(continued: CONSOLE sub-commands)
WAITFOR NLMLOAD NLMName [Timeout]
WAITFOR NLMUNLOAD NLMName [Timeout]
Waits for the specified NLM to be loaded/unloaded.
Note that the name is the internal name of the NLM, which
is not necessarily identical to the file name. If in doubt,
consult the information obtained with STATUS N.
Note that only the base name is used for this command -
the file extension (.NLM, .LAN etc.) is ignored.
If the NLM is not loaded/unloaded within the specified
timeout (in seconds), the command continues nonetheless.
The default timeout is 30 seconds.
Example: WAITFOR NLMUNLOAD NGM 600
CLOSE ScreenName
Switches to the specified virtual screen and "presses the
ENTER key" there. Used to close screens displaying the
message "Press any key to close screen".
MESSAGE MHS-Address;Subject
Sends an MHS Message with the specified subject to the
specified address. Address and Subject are separated by a
semicolon.
CRC FilePath
Calculates the CRC32 (CCITT) of the specified file. This CRC
is the same as it is used by popular archiving programs such
as PKZIP or ARJ. Used to compare file versions with known
references. See also the description of the enclosed CRC32
utility program for DOS.
DIR FilePath [/S]
Lists the directory. Note that you have to specify a file
wildcard, such as in
DIR SYS:SYSTEM/*.*
Option /S will cause subdirectories to be listed as well.
Note that the result is sent as the body of a message.
Therefore, if its length exceeds 64K and Global MHS has to
"downgrade" the message, i.e. convert from SMF-71 to SMF-70,
the message will be rejected by GMHS because GMHS insists
that an SMF-64 message cannot be longer than 64K.
Such a limit does not exist if the format stays at SMF-71
or if the message is handled by MHS 1.5 or Connect².
FETCH FilePath
Attaches the specified file to a reply message.
Example usage of the CONSOLE command to control the backup of a
NetWare SQL database:
To start backup, send the following message to AdminApp:
Subject: CONSOLE !You#will#never#guess!
COMMAND Load NSUTIL -StartBU DatabaseName
DELAY 20
STATUS Operator@Company;S
CLOSE NSUTIL
MESSAGE Backup@Company;BACKUP MyServer
This places the database in continuous-operation (backup)
mode, sends a status message to the administrator and closes
NSUTIL's screen. Then it sends a message to a backup gateway.
This gateway (example shown next page) (ab)uses the MHS
server to perform a backup procedure. Upon completion of
that procedure, it sends the following message to AdminApp:
Subject: CONSOLE !You#will#never#guess!
COMMAND Load NSUTIL -EndBU DatabaseName
DELAY 20
STATUS Operator@Company;S
CLOSE NSUTIL
MESSAGE Operator@Company;Database backup completed
Example RUNIT.BAT for Infinite Technologies' Connect² MHS
compatible message router which can directly run batch files
as gateways:
(Note: Specify parameters for SENDIT on a single line!)
@echo off
cls
echo.
echo. RUNIT Gateway to control Backup
echo.
echo. Processing message from %gwfrom% ...
echo.
rem delete old log file, if present
if exist backup.log del result
rem Parameter n is n-th Word on Subject line
rem we're using Parameter 1 as a keyword
rem
rem Command 1: BACKUP
rem
if not [%1]==[BACKUP] goto nobackup
BackupProgram Script=%2 Logfile=BACKUP.LOG
if errorlevel 1 goto backuperr
sendit /t%gwfrom% /f%GWNAME%@%GWNAME%(Backup)
/sBackup completed. /b /q
goto cont1
:backuperr
sendit /t%Operator@Company /f%GWNAME%@%GWNAME%(Backup)
/sBackup FAILED! /bBACKUP.LOG /q
:cont
sendit /tAdminapp@Company /f%GWNAME%@%GWNAME%(Backup)
/sCONSOLE !You#will#never#guess! /bENDBU.MSG
sendit /t%Operator@Company /f%GWNAME%@%GWNAME%(Backup)
/sBackup completed. /bBACKUP.LOG /q
goto cont2
rem
rem Example command 2:
rem
if not [%1]==[LIST] goto cont2
BackupProgram List=%2 Logfile=BACKUP.LOG
sendit /t%Operator@Company /f%GWNAME%@%GWNAME%(Backup)
/sRequested List /bBACKUP.LOG /q
:cont2
rem More commands can be implemented the same way
rem
rem Delete already-processed message (C² doesn't)
del %GWDIR%OUT\%GWMSG%
echo - Done!
(STARTBU.MSG/ENDBU.MSG contain the text of the previously
shown mail messages).
Please refer to the documentation of Connect² as well.
For sites running Global MHS or MHS 1.5, Infinite
Technologies offers a gateway called RunIt! that offers
this functionality for these environments.
┌───────────────────────────┐
│ The CRC32 Utility Program │
└───────────────────────────┘
The CRC32 program is a DOS-based utility to calculate the 32bit CRC
(cyclic redundancy check) checksum as defined by ANSI X3.66,
FIPS PUB 71, FED-STD-1003 or CCITT/ITU-T X.25.
This is the same CRC method as implemented in popular compression or
archiving programs such as PKZIP(tm), ARJ(tm) and others.
Note to those who want to know it all: The polynomial being used is
X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0.
Using the program
─────────────────
crc32 filespec { filespec }
Filespecs may use the wildcard characters * and ? as common in DOS.
The option /X<ext>{,<ext>} excludes files with extension <ext> for
the rest of the command line or up to the next /X option.
Progress of the CRC calculation is indicated by a spinning line.
The program's output may still be redirected by DOS.
Example
───────
crc32 /XSYS SYS:SYSTEM/*.* /X SYS:PUBLIC/*.*
Hints
─────
The same file may be specified multiple times on the command
line to test disk/LAN integrity, e.g.
crc32 test.dat test.dat test.dat test.dat test.dat test.dat
The program should of course calculate the same CRC value
every time.
To quickly tell if two files are equal, use (for example)
crc32 SYS:SYSTEM/CLIB.NLM SYS:SYSTEM/CLIB.OLD
The advantage to comparing files with a program like DIFF or FC
is that using ADMINAPP, the CRC32 value can be computed and sent
quickly for a remote file, even if it is several megabytes in
size. FC would require the whole file to be transferred for the
comparison.
Alternatively, the CRC can bee transferred by even lower-tech
methods, such as reading over the phone.
┌────────────────────────────────────────────────────────┐
│ Planned enhancements to AdminApp for upcoming releases │
└────────────────────────────────────────────────────────┘
- Monitoring NetWare internal events such as Volume mount/dismount,
user login/logout, bindery security change etc., configurable
through the INI file and/or E-mail commands
- Monitoring log files for error messages
- Conditional execution & labels in CONSOLE subcommand-blocks,
e.g. depending on the result of WAITFOR NLMLOAD
- Exploit the diagnostics capabilities built into NetWare 4 to return
information about memory utilization etc.
Any other suggestions are cordially welcomed!
┌──────────────────┐
│ Revision History │
└──────────────────┘
V1.00 94/10/23 Initial Beta Release.
V1.00A 94/10/30 Added NLM Info, WAITFOR NLMLOAD,
WAITFOR NLMLOAD commands.
V1.10 94/11/07 Added NetWare 3.x support for NLM Info/WAIT
commands. Cleaned up UNLOAD code. Beta Rel. 2.
V1.20 94/12/27 Release candidate
V1.20A 94/12/30 Fixed NW 3.11 NLM list garbage.
First production release.
V1.20B 95/01/11 Moved ConsolePassword= setting to [Settings]
section. Added MailPollDelay= setting.
Clarified documentation.
┌──────────────────────┐
│ Ordering Information │
└──────────────────────┘
Administrator's Apprentice is supplied as a 30-day evaluation
version. You are welcome to try out the program during that period.
After this period, the evaluation version will cease to run.
You may install a purchased license at any time without any change
in configuration.
You are also welcome to give copies of this evaluation package to
whomever you wish, provided that you pass the original archive in
its entirety.
The price of the licensed version is US $280 per server in the U.S.,
or ATS 3000 in Europe and elsewhere, including E-mail delivery, but
excluding mail or courier S/H.
E-mail if you want to negotiate site or corporate licenses.
Resellers please inquire about terms.
To order the licensed version, contact
Peter Holzleitner Consulting
A-3704 Grosswetzdorf 1
Austria, Europe
by E-mail as
MHS:
Peter@PHConslt (via LEND-ING, CSERVE, NHUB)
Internet:
pholzl@ping.at
From CompuServe, you may enter
MHS:Peter@PHCONSLT (preferred as it is faster for me)
or
100427,234